<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>左移与右移</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            width: 150px;
            height: 260px;
            /*border: 2px solid #000000;*/
            float: left;
            margin-left: 120px;
            margin-top: 70px;
        }

        .boxDiv {
            margin: 30px 0 0 30px;
            width: 700px;
            height: 400px;
            background: rgba(255, 192, 203, 0.35);
            border: 2px solid #000000;
        }

        .div_left {
            margin-right: 0;
            background: white;
        }

        .div_right {
            margin-left: 0;
            background: white;
        }

        .div_option {
            width: 100px;
            margin-left: 25px;
            margin-right: 25px;
            border: none;
            text-align: center;
        }

        input {
            margin-top: 26px;
            font-size: 25px;
            border: none;
            /*width: 50px;*/
        }

        option {
            font-size: 20px;
            margin-top: 5px;
            text-align: center;
        }

        select {
            width: 100%;
            height: 100%;
            background: rgba(184, 184, 184, 0.18);
        }

        p {
            text-align: center;
            font-family: 楷体;
            background: #9fa596;
        }
    </style>
    <script src="../../jquery-js/jquery.js"></script>
    <script>
        $(function () {
            //右移
            $('.l_right').click(function () {
                $('.div_right select').append($('.div_left select option:selected'));
            });

            //左移
            $('.l_left').click(function () {
                $('.div_left select').append($('.div_right select option:selected'));
            });

            //全部右移
            $('.l_all_right').click(function () {
                $('.div_right select').append($('.div_left select option'));
            });

            //全部左移
            $('.l_all_left').click(function () {
                $('.div_left select').append($('.div_right select option'));
            });
        })
    </script>
</head>
<body>
<div class="boxDiv">
    <div class="div_left">
        <p>可选项</p>
        <select multiple="multiple">
            <option value="">东皇</option>
            <option value="">西王</option>
            <option value="">玄天</option>
            <option value="">长生</option>
            <option value="">玉皇</option>
            <option value="">紫薇</option>
            <option value="">皇天</option>
            <option value="">后土</option>
        </select>
    </div>
    <div class="div_option">
        <input class="l_right" type="button" value=">>"><br>
        <input class="l_left" type="button" value="<<"><br>
        <input class="l_all_right" type="button" value=">>>>"><br>
        <input class="l_all_left" type="button" value="<<<<"><br>
    </div>
    <div class="div_right">
        <p>已选项</p>
        <select multiple="multiple"></select>
    </div>
</div>

</body>
</html>